import React, { Component } from 'react'
import RouterView from '../router/RouterView'
import {NavLink} from 'react-router-dom'
//路由页面
export default class Home extends Component {
    // componentDidMount(){
    //     Axios.get('/getList').then(res=>{
    //         console.log(res.data);
            
    //     })
    // }
    render() {
        let {list} =this.props
        let arr=list.filter(item=>item.path)
        return (
            <div className="home">
                <div className="top">
                    {
                        arr.map( (item,index)=><NavLink key={index} to={item.path} >
                            {item.title}
                        </NavLink> )
                    }
                </div>
                <div className="main" style={{height:'567px'}}>
                    <RouterView routers={list} />
                </div>
            </div>
        )
    }
}
